.class public Llt/noframe/gpsfarmguide/states/map_states/AreaDrawingState;
.super Ljava/lang/Object;
.source "AreaDrawingState.java"

# interfaces
.implements Llt/noframe/gpsfarmguide/states/map_states/MapState;


# instance fields
.field private data:Llt/noframe/gpsfarmguide/Data;


# direct methods
.method public constructor <init>()V
    .locals 7

    .line 32
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 33
    invoke-static {}, Llt/noframe/gpsfarmguide/Data;->getInstance()Llt/noframe/gpsfarmguide/Data;

    move-result-object v0

    iput-object v0, p0, Llt/noframe/gpsfarmguide/states/map_states/AreaDrawingState;->data:Llt/noframe/gpsfarmguide/Data;

    .line 34
    iget-object v0, p0, Llt/noframe/gpsfarmguide/states/map_states/AreaDrawingState;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/Data;->getMapStatesController()Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;

    move-result-object v0

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;->getButton1()Landroid/view/MenuItem;

    move-result-object v0

    const/4 v1, 0x1

    invoke-interface {v0, v1}, Landroid/view/MenuItem;->setVisible(Z)Landroid/view/MenuItem;

    .line 35
    iget-object v0, p0, Llt/noframe/gpsfarmguide/states/map_states/AreaDrawingState;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/Data;->getMapStatesController()Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;

    move-result-object v0

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;->getButton1()Landroid/view/MenuItem;

    move-result-object v0

    const v2, 0x7f08016e

    invoke-interface {v0, v2}, Landroid/view/MenuItem;->setIcon(I)Landroid/view/MenuItem;

    .line 36
    iget-object v0, p0, Llt/noframe/gpsfarmguide/states/map_states/AreaDrawingState;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/Data;->getMapStatesController()Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;

    move-result-object v0

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;->getButton2()Landroid/view/MenuItem;

    move-result-object v0

    const/4 v2, 0x0

    invoke-interface {v0, v2}, Landroid/view/MenuItem;->setVisible(Z)Landroid/view/MenuItem;

    .line 37
    iget-object v0, p0, Llt/noframe/gpsfarmguide/states/map_states/AreaDrawingState;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/Data;->getMapStatesController()Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;

    move-result-object v0

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;->getButton2()Landroid/view/MenuItem;

    move-result-object v0

    const v3, 0x7f080161

    invoke-interface {v0, v3}, Landroid/view/MenuItem;->setIcon(I)Landroid/view/MenuItem;

    .line 38
    iget-object v0, p0, Llt/noframe/gpsfarmguide/states/map_states/AreaDrawingState;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/Data;->getMapStatesController()Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;

    move-result-object v0

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;->getButton3()Landroid/view/MenuItem;

    move-result-object v0

    invoke-interface {v0, v1}, Landroid/view/MenuItem;->setVisible(Z)Landroid/view/MenuItem;

    .line 39
    iget-object v0, p0, Llt/noframe/gpsfarmguide/states/map_states/AreaDrawingState;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/Data;->getMapStatesController()Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;

    move-result-object v0

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;->getButton3()Landroid/view/MenuItem;

    move-result-object v0

    const v3, 0x7f08015b

    invoke-interface {v0, v3}, Landroid/view/MenuItem;->setIcon(I)Landroid/view/MenuItem;

    .line 40
    iget-object v0, p0, Llt/noframe/gpsfarmguide/states/map_states/AreaDrawingState;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/Data;->getMapStatesController()Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;

    move-result-object v0

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;->getZoomOutButton()Landroid/widget/ImageButton;

    move-result-object v0

    invoke-virtual {v0, v2}, Landroid/widget/ImageButton;->setVisibility(I)V

    .line 41
    iget-object v0, p0, Llt/noframe/gpsfarmguide/states/map_states/AreaDrawingState;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/Data;->getMapStatesController()Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;

    move-result-object v0

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;->getLayersButton()Landroid/view/MenuItem;

    move-result-object v0

    invoke-interface {v0, v2}, Landroid/view/MenuItem;->setVisible(Z)Landroid/view/MenuItem;

    .line 42
    iget-object v0, p0, Llt/noframe/gpsfarmguide/states/map_states/AreaDrawingState;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/Data;->getMapStatesController()Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;

    move-result-object v0

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;->getCenter()Landroid/widget/ImageButton;

    move-result-object v0

    invoke-virtual {v0, v2}, Landroid/widget/ImageButton;->setVisibility(I)V

    .line 44
    invoke-static {}, Llt/noframe/gpsfarmguide/App;->getContext()Landroid/content/Context;

    move-result-object v0

    invoke-static {v0}, Llt/noframe/gpsfarmguide/utils/ScreenHelper;->getScreenOrientation(Landroid/content/Context;)I

    move-result v0

    const-wide/high16 v3, 0x4049000000000000L    # 50.0

    if-ne v0, v1, :cond_0

    .line 45
    iget-object v0, p0, Llt/noframe/gpsfarmguide/states/map_states/AreaDrawingState;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/Data;->getMap()Lcom/google/android/gms/maps/GoogleMap;

    move-result-object v0

    invoke-static {}, Llt/noframe/gpsfarmguide/App;->getContext()Landroid/content/Context;

    move-result-object v5

    invoke-static {v3, v4, v5}, Llt/noframe/gpsfarmguide/utils/ScreenHelper;->dpToPx(DLandroid/content/Context;)I

    move-result v5

    invoke-static {}, Llt/noframe/gpsfarmguide/App;->getContext()Landroid/content/Context;

    move-result-object v6

    invoke-static {v3, v4, v6}, Llt/noframe/gpsfarmguide/utils/ScreenHelper;->dpToPx(DLandroid/content/Context;)I

    move-result v3

    invoke-virtual {v0, v2, v5, v2, v3}, Lcom/google/android/gms/maps/GoogleMap;->setPadding(IIII)V

    .line 46
    invoke-static {}, Llt/noframe/gpsfarmguide/App;->getContext()Landroid/content/Context;

    move-result-object v0

    iget-object v3, p0, Llt/noframe/gpsfarmguide/states/map_states/AreaDrawingState;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {v3}, Llt/noframe/gpsfarmguide/Data;->getMapStatesController()Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;

    move-result-object v3

    invoke-virtual {v3}, Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;->getZoomOutButton()Landroid/widget/ImageButton;

    move-result-object v3

    const-wide v4, 0x405a400000000000L    # 105.0

    invoke-static {}, Llt/noframe/gpsfarmguide/App;->getContext()Landroid/content/Context;

    move-result-object v6

    invoke-static {v4, v5, v6}, Llt/noframe/gpsfarmguide/utils/ScreenHelper;->dpToPx(DLandroid/content/Context;)I

    move-result v4

    invoke-static {v0, v3, v4, v1}, Llt/noframe/gpsfarmguide/utils/ScreenHelper;->setTopMargins(Landroid/content/Context;Landroid/widget/ImageButton;IZ)V

    .line 47
    invoke-static {}, Llt/noframe/gpsfarmguide/App;->getContext()Landroid/content/Context;

    move-result-object v0

    iget-object v3, p0, Llt/noframe/gpsfarmguide/states/map_states/AreaDrawingState;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {v3}, Llt/noframe/gpsfarmguide/Data;->getMapStatesController()Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;

    move-result-object v3

    invoke-virtual {v3}, Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;->getCenter()Landroid/widget/ImageButton;

    move-result-object v3

    const-wide v4, 0x404b800000000000L    # 55.0

    invoke-static {}, Llt/noframe/gpsfarmguide/App;->getContext()Landroid/content/Context;

    move-result-object v6

    invoke-static {v4, v5, v6}, Llt/noframe/gpsfarmguide/utils/ScreenHelper;->dpToPx(DLandroid/content/Context;)I

    move-result v4

    invoke-static {v0, v3, v4, v1}, Llt/noframe/gpsfarmguide/utils/ScreenHelper;->setTopMargins(Landroid/content/Context;Landroid/widget/ImageButton;IZ)V

    goto :goto_0

    .line 49
    :cond_0
    iget-object v0, p0, Llt/noframe/gpsfarmguide/states/map_states/AreaDrawingState;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/Data;->getMap()Lcom/google/android/gms/maps/GoogleMap;

    move-result-object v0

    invoke-static {}, Llt/noframe/gpsfarmguide/App;->getContext()Landroid/content/Context;

    move-result-object v5

    invoke-static {v3, v4, v5}, Llt/noframe/gpsfarmguide/utils/ScreenHelper;->dpToPx(DLandroid/content/Context;)I

    move-result v5

    invoke-static {}, Llt/noframe/gpsfarmguide/App;->getContext()Landroid/content/Context;

    move-result-object v6

    invoke-static {v3, v4, v6}, Llt/noframe/gpsfarmguide/utils/ScreenHelper;->dpToPx(DLandroid/content/Context;)I

    move-result v3

    invoke-virtual {v0, v2, v5, v2, v3}, Lcom/google/android/gms/maps/GoogleMap;->setPadding(IIII)V

    .line 50
    invoke-static {}, Llt/noframe/gpsfarmguide/App;->getContext()Landroid/content/Context;

    move-result-object v0

    iget-object v3, p0, Llt/noframe/gpsfarmguide/states/map_states/AreaDrawingState;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {v3}, Llt/noframe/gpsfarmguide/Data;->getMapStatesController()Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;

    move-result-object v3

    invoke-virtual {v3}, Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;->getZoomOutButton()Landroid/widget/ImageButton;

    move-result-object v3

    const-wide/high16 v4, 0x4054000000000000L    # 80.0

    invoke-static {}, Llt/noframe/gpsfarmguide/App;->getContext()Landroid/content/Context;

    move-result-object v6

    invoke-static {v4, v5, v6}, Llt/noframe/gpsfarmguide/utils/ScreenHelper;->dpToPx(DLandroid/content/Context;)I

    move-result v4

    invoke-static {v0, v3, v4, v1}, Llt/noframe/gpsfarmguide/utils/ScreenHelper;->setTopMargins(Landroid/content/Context;Landroid/widget/ImageButton;IZ)V

    .line 51
    invoke-static {}, Llt/noframe/gpsfarmguide/App;->getContext()Landroid/content/Context;

    move-result-object v0

    iget-object v3, p0, Llt/noframe/gpsfarmguide/states/map_states/AreaDrawingState;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {v3}, Llt/noframe/gpsfarmguide/Data;->getMapStatesController()Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;

    move-result-object v3

    invoke-virtual {v3}, Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;->getCenter()Landroid/widget/ImageButton;

    move-result-object v3

    const-wide/high16 v4, 0x4044000000000000L    # 40.0

    invoke-static {}, Llt/noframe/gpsfarmguide/App;->getContext()Landroid/content/Context;

    move-result-object v6

    invoke-static {v4, v5, v6}, Llt/noframe/gpsfarmguide/utils/ScreenHelper;->dpToPx(DLandroid/content/Context;)I

    move-result v4

    invoke-static {v0, v3, v4, v1}, Llt/noframe/gpsfarmguide/utils/ScreenHelper;->setTopMargins(Landroid/content/Context;Landroid/widget/ImageButton;IZ)V

    .line 53
    :goto_0
    invoke-static {}, Llt/noframe/gpsfarmguide/App;->getContext()Landroid/content/Context;

    move-result-object v0

    check-cast v0, Llt/noframe/gpsfarmguide/views/ActivityDrawer;

    invoke-virtual {v0, v2}, Llt/noframe/gpsfarmguide/views/ActivityDrawer;->setDrawerLocked(Z)V

    .line 55
    invoke-static {}, Llt/noframe/gpsfarmguide/App;->getContext()Landroid/content/Context;

    move-result-object v0

    const-string v1, "manual_measuring_started"

    invoke-static {v1, v0}, Llt/noframe/gpsfarmguide/App;->stateChanged(Ljava/lang/String;Landroid/content/Context;)V

    return-void
.end method


# virtual methods
.method public button1()V
    .locals 2

    .line 60
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    const-string v1, "measures size before:"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-static {}, Llt/noframe/gpsfarmguide/Data;->getInstance()Llt/noframe/gpsfarmguide/Data;

    move-result-object v1

    invoke-virtual {v1}, Llt/noframe/gpsfarmguide/Data;->getAreas()Ljava/util/List;

    move-result-object v1

    invoke-interface {v1}, Ljava/util/List;->size()I

    move-result v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    const-string v1, "measures size"

    invoke-static {v1, v0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    .line 61
    invoke-static {}, Llt/noframe/gpsfarmguide/dialogs/MeasuresDialogs;->endMeasuring()V

    return-void
.end method

.method public button2()V
    .locals 0

    return-void
.end method

.method public button3()V
    .locals 3

    .line 85
    iget-object v0, p0, Llt/noframe/gpsfarmguide/states/map_states/AreaDrawingState;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/Data;->getCurrent_measuring()Llt/noframe/gpsfarmguide/models/MeasuringModel;

    move-result-object v0

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/models/MeasuringModel;->getId()I

    move-result v0

    const/4 v1, 0x3

    if-lez v0, :cond_0

    iget-object v0, p0, Llt/noframe/gpsfarmguide/states/map_states/AreaDrawingState;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/Data;->getCurrent_measuring()Llt/noframe/gpsfarmguide/models/MeasuringModel;

    move-result-object v0

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/models/AbstractMeasuringModel;->getPoints()Ljava/util/List;

    move-result-object v0

    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v0

    if-le v0, v1, :cond_0

    .line 86
    invoke-static {}, Llt/noframe/gpsfarmguide/database/DB;->getDB()Llt/noframe/gpsfarmguide/database/DB;

    move-result-object v0

    iget-object v1, p0, Llt/noframe/gpsfarmguide/states/map_states/AreaDrawingState;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {v1}, Llt/noframe/gpsfarmguide/Data;->getCurrent_measuring()Llt/noframe/gpsfarmguide/models/MeasuringModel;

    move-result-object v1

    invoke-virtual {v0, v1}, Llt/noframe/gpsfarmguide/database/DB;->saveMeasure(Llt/noframe/gpsfarmguide/models/MeasuringModel;)V

    .line 87
    iget-object v0, p0, Llt/noframe/gpsfarmguide/states/map_states/AreaDrawingState;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/Data;->getGui()Llt/noframe/gpsfarmguide/gui/Gui;

    move-result-object v0

    const/4 v1, 0x0

    invoke-interface {v0, v1}, Llt/noframe/gpsfarmguide/gui/Gui;->clearGui(I)V

    .line 88
    iget-object v0, p0, Llt/noframe/gpsfarmguide/states/map_states/AreaDrawingState;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/Data;->getMapStatesController()Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;

    move-result-object v0

    new-instance v1, Llt/noframe/gpsfarmguide/states/map_states/FreeMapState;

    invoke-direct {v1}, Llt/noframe/gpsfarmguide/states/map_states/FreeMapState;-><init>()V

    invoke-virtual {v0, v1}, Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;->setCurrentState(Llt/noframe/gpsfarmguide/states/map_states/MapState;)V

    goto :goto_0

    .line 89
    :cond_0
    iget-object v0, p0, Llt/noframe/gpsfarmguide/states/map_states/AreaDrawingState;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/Data;->getCurrent_measuring()Llt/noframe/gpsfarmguide/models/MeasuringModel;

    move-result-object v0

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/models/AbstractMeasuringModel;->getPoints()Ljava/util/List;

    move-result-object v0

    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v0

    if-le v0, v1, :cond_1

    .line 90
    new-instance v0, Landroid/content/Intent;

    invoke-static {}, Llt/noframe/gpsfarmguide/App;->getContext()Landroid/content/Context;

    move-result-object v1

    const-class v2, Llt/noframe/gpsfarmguide/views/ActivitySave;

    invoke-direct {v0, v1, v2}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    .line 92
    invoke-static {}, Llt/noframe/gpsfarmguide/App;->getContext()Landroid/content/Context;

    move-result-object v1

    check-cast v1, Llt/noframe/gpsfarmguide/views/ActivityDrawer;

    const/4 v2, 0x2

    invoke-virtual {v1, v0, v2}, Landroidx/fragment/app/FragmentActivity;->startActivityForResult(Landroid/content/Intent;I)V

    goto :goto_0

    .line 95
    :cond_1
    invoke-static {}, Llt/noframe/gpsfarmguide/App;->getContext()Landroid/content/Context;

    move-result-object v0

    invoke-static {v0}, Llt/noframe/gpsfarmguide/dialogs/ErrorDialogs;->notEnoughPoints(Landroid/content/Context;)V

    :goto_0
    return-void
.end method

.method public buttonCenter()V
    .locals 3

    .line 107
    invoke-static {}, Llt/noframe/gpsfarmguide/App;->getContext()Landroid/content/Context;

    move-result-object v0

    const/4 v1, 0x1

    const/4 v2, 0x0

    invoke-static {v0, v1, v1, v2}, Llt/noframe/gpsfarmguide/LocationTracking;->centerMyPosition(Landroid/content/Context;ZZZ)Z

    return-void
.end method

.method public buttonZoom()V
    .locals 2

    .line 100
    iget-object v0, p0, Llt/noframe/gpsfarmguide/states/map_states/AreaDrawingState;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/Data;->getCurrent_measuring()Llt/noframe/gpsfarmguide/models/MeasuringModel;

    move-result-object v0

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/models/AbstractMeasuringModel;->getPoints()Ljava/util/List;

    move-result-object v0

    .line 101
    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v1

    if-lez v1, :cond_0

    const/4 v1, 0x2

    .line 102
    invoke-static {v0, v1}, Llt/noframe/gpsfarmguide/utils/Camera;->showMeasure(Ljava/util/List;I)V

    :cond_0
    return-void
.end method

.method public onBackPressed()V
    .locals 0

    .line 112
    invoke-static {}, Llt/noframe/gpsfarmguide/dialogs/MeasuresDialogs;->endMeasuring()V

    return-void
.end method
